/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * FrmAprob.java
 *
 * Created on 19/02/2011, 01:39:46 AM
 */
package interfaz1;

import java.util.ConcurrentModificationException;
import java.util.ListIterator;

/**
 *
 * @author CLIENTE
 */
public class FrmAprob extends javax.swing.JFrame {

    /** Creates new form FrmAprob */
    public FrmAprob() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTabAprob = new javax.swing.JTable();
        btngeneraraprob = new javax.swing.JButton();
        btnsaliraprob = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Listados");
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jLabel1.setFont(new java.awt.Font("Bookman Old Style", 1, 12));
        jLabel1.setText("Estudiantes Aprobados");
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(121, 30, 170, -1));

        jTabAprob.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Cedula", "Nombre", "Apellido", "Nota Final"
            }
        ));
        jScrollPane1.setViewportView(jTabAprob);

        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(60, 60, 290, 180));

        btngeneraraprob.setText("Generar");
        btngeneraraprob.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btngeneraraprobActionPerformed(evt);
            }
        });
        getContentPane().add(btngeneraraprob, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 260, 80, -1));

        btnsaliraprob.setText("Salir");
        btnsaliraprob.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnsaliraprobActionPerformed(evt);
            }
        });
        getContentPane().add(btnsaliraprob, new org.netbeans.lib.awtextra.AbsoluteConstraints(240, 260, 80, -1));

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-416)/2, (screenSize.height-336)/2, 416, 336);
    }// </editor-fold>//GEN-END:initComponents

    private void btnsaliraprobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnsaliraprobActionPerformed

        dispose();

        // TODO add your handling code here:
    }//GEN-LAST:event_btnsaliraprobActionPerformed

    private void btngeneraraprobActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btngeneraraprobActionPerformed
        // TODO add your handling code here:
        FrmOperacionesseccion.getMiseccion().ListadoAprobados(FrmOperacionesseccion.getMiestudiante(), FrmOperacionesseccion.getMiprofesor());
        ListIterator<Estudiante> it = FrmOperacionesseccion.getMiseccion().list_aux.listIterator();
        int indice = 0;
        while (it.hasNext()) {
             Estudiante e = it.next();

                if (FrmOperacionesseccion.getMiprofesor().AsignarEstado(e).equals("Aprobado")) {
                    FrmOperacionesseccion.getMiseccion().list_aux.add(e);
                    jTabAprob.setValueAt(e.getCedula(), indice, 0);
                    jTabAprob.setValueAt(e.getNombre(), indice, 1);
                    jTabAprob.setValueAt(e.getApellido(), indice, 2);
                    jTabAprob.setValueAt(e.getNotaf(), indice, 3);
                    indice++;
                }
            
        }

    }//GEN-LAST:event_btngeneraraprobActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new FrmAprob().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btngeneraraprob;
    private javax.swing.JButton btnsaliraprob;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTabAprob;
    // End of variables declaration//GEN-END:variables
}
